<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<title>I miei Viaggi</title>
	<link rel="stylesheet" type="text/css" href="../styles/style.css" />
</h:head>
<h:body>
<div id="container">
<div id="box">
<header class="banner">
<span id="titoloPagina"> Seleziona un tuo Sogno </span>
</header>

<div id="externalborder1">
<p:spacer height="40px" />

<h:form id="form"> 
      
      <p:growl id="growl" showDetail="true" sticky="true" />
	<h:panelGroup  >
			<div id="infoAgg" style="text-align: center;">
			<h:outputText value="Non hai selezionato nessun viaggio!" rendered="#{param.noIst}"/><br/>
			<h:outputText value="Il viaggio risulta già pagato!" rendered="#{param.giaPagato}"/><br/>
			</div>
			</h:panelGroup>
			<p:spacer height="40px" />

	<div id="externalborderTab"> 
		<p:dataTable id="viaggiSel" var="viaggioDTO" rowKey="#{viaggioDTO.idViaggio}" value="#{pagamentoPP.viaggi}" paginator="true" rows="7"
                 selection="#{pagamentoPP.viaggio}" selectionMode="single" sortMode="multiple" >  
  
  
   		
			<p:ajax event="rowSelect" update=":form:growl" listener="#{pagamentoPP.onRowSelectViaggio}"/>

   		
		    <p:column id="destinazione" sortBy="pacchetto.citta" headerText="Destinazione">  
	            <h:outputText value="#{viaggioDTO.pacchetto.citta}" />  
	        </p:column> 
	        
	        <p:column id="tipologia" sortBy="pacchetto.tipologia" headerText="Tipologia">  
	            <h:outputText value="#{viaggioDTO.pacchetto.tipologia}" />  
	        </p:column>
	          
	        <p:column headerText="Sognatori">  
	            <h:outputText value="#{viaggioDTO.numeroPersone}" />  
	        </p:column>  
	        
	        <p:column headerText="ID Sogno">  
	            <h:outputText value="#{viaggioDTO.idViaggio}" />  
	        </p:column>
	           
	        <p:column headerText="Lista regalo">  
	            <h:outputText value="#{viaggioDTO.translateBoolean()}" />  
	        </p:column>
	                
	    
	        
	    </p:dataTable>
    </div>
    </h:form>
    <p:spacer height="40px"></p:spacer>
    
 	<h:form>
 	
 	 	<div id="columnBox" style="margin:0px auto; width:70%">
	
	<div id="column1" style="float:left; margin:0; margin-left:4%; width:33%;">
		<div id="registerButton">
<h:commandLink id="registerlink" action="#{pagamentoPP.vediIstanze()}">
<div class="button" id="register">
Visualizza Sogno
</div>
</h:commandLink>
</div>
</div>

<div id="column2" style="float:left; margin:0;width:25%;">
<div class="padder" id="padder">
</div>
</div>

<div id="column3" style="float:left; margin:0;width:33%;">
	<div id="registerButton">
<h:commandLink id="visualizzalink" action="#{pagamentoPP.getIstanzeDaPagare()}">
<div class="button" id="register">
Paga Sogno
</div>
</h:commandLink>
</div>

				</div>
				</div>
  		
  	</h:form>
    
    

    </div>
</div>
<div id="push">
</div>
</div>

<div id="footer">
<h:button id="homepage" value="Homepage" outcome="index.xhtml"></h:button>
</div>

</h:body>

    
</html>